// Led.cpp: implementation of the CLed class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "8085.h"
#include "Led.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CLed::CLed()
{
    Init();
}

CLed::~CLed()
{

}

void CLed::SetOffColor(COLORREF color)
{
    m_LedOff = color;
}

void CLed::SetOnColor(COLORREF color)
{
    m_LedOn = color;
}

void CLed::Init()
{
    int red=200,green=0,blue=0;
    SetColor(red,green,blue);
    m_nLEDSegmentWidth = m_nLEDSegmentLength=0;
    m_bEmptyLed = FALSE;
}


void CLed::Draw(CDC *pDC,unsigned nState)
{

}

int CLed::GetHeight()
{
    return 0;
}

int CLed::GetWidth()
{
    return m_nLEDSegmentWidth;
}

void CLed::SetColor(COLORREF c)
{
    int red,green,blue;
    red = c & 0xff;
    green = (c & 0xff00)>>16;
    blue = (c & 0xff0000)>>32;
    SetColor(red,green,blue);
}

void CLed::SetColor(int red, int green, int blue)
{
    SetOnColor(RGB(red,green,blue));
    SetOffColor(RGB(red/3,green/3,blue/3));
}
